Optimal. Leaf size=87 \[ -\frac {(e f-d g)^2}{4 d e^3 (d+e x)^2}-\frac {(e f-d g) (e f+3 d g)}{4 d^2 e^3 (d+e x)}+\frac {(e f+d g)^2 \tanh ^{-1}\left (\frac {e x}{d}\right )}{4 d^3 e^3} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 87, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.103, Rules used = {862, 90, 214}
\begin {gather*} \frac {(d g+e f)^2 \tanh ^{-1}\left (\frac {e x}{d}\right )}{4 d^3 e^3}-\frac {(3 d g+e f) (e f-d g)}{4 d^2 e^3 (d+e x)}-\frac {(e f-d g)^2}{4 d e^3 (d+e x)^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 90
Rule 214
Rule 862
Rubi steps
\begin {align*} \int \frac {(f+g x)^2}{(d+e x)^2 \left (d^2-e^2 x^2\right )} \, dx &=\int \frac {(f+g x)^2}{(d-e x) (d+e x)^3} \, dx\\ &=\int \left (\frac {(-e f+d g)^2}{2 d e^2 (d+e x)^3}+\frac {(e f-d g) (e f+3 d g)}{4 d^2 e^2 (d+e x)^2}+\frac {(e f+d g)^2}{4 d^2 e^2 \left (d^2-e^2 x^2\right )}\right ) \, dx\\ &=-\frac {(e f-d g)^2}{4 d e^3 (d+e x)^2}-\frac {(e f-d g) (e f+3 d g)}{4 d^2 e^3 (d+e x)}+\frac {(e f+d g)^2 \int \frac {1}{d^2-e^2 x^2} \, dx}{4 d^2 e^2}\\ &=-\frac {(e f-d g)^2}{4 d e^3 (d+e x)^2}-\frac {(e f-d g) (e f+3 d g)}{4 d^2 e^3 (d+e x)}+\frac {(e f+d g)^2 \tanh ^{-1}\left (\frac {e x}{d}\right )}{4 d^3 e^3}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.05, size = 87, normalized size = 1.00 \begin {gather*} \frac {\frac {2 d (-e f+d g) \left (2 d^2 g+e^2 f x+d e (2 f+3 g x)\right )}{(d+e x)^2}-(e f+d g)^2 \log (d-e x)+(e f+d g)^2 \log (d+e x)}{8 d^3 e^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.09, size = 148, normalized size = 1.70
method | result | size |
norman | \(\frac {\frac {d^{2} g^{2}-e^{2} f^{2}}{2 d \,e^{3}}+\frac {\left (3 d^{2} g^{2}-2 d e f g -e^{2} f^{2}\right ) x}{4 d^{2} e^{2}}}{\left (e x +d \right )^{2}}-\frac {\left (d^{2} g^{2}+2 d e f g +e^{2} f^{2}\right ) \ln \left (-e x +d \right )}{8 e^{3} d^{3}}+\frac {\left (d^{2} g^{2}+2 d e f g +e^{2} f^{2}\right ) \ln \left (e x +d \right )}{8 e^{3} d^{3}}\) | \(138\) |
default | \(-\frac {-3 d^{2} g^{2}+2 d e f g +e^{2} f^{2}}{4 d^{2} e^{3} \left (e x +d \right )}-\frac {d^{2} g^{2}-2 d e f g +e^{2} f^{2}}{4 e^{3} d \left (e x +d \right )^{2}}+\frac {\left (d^{2} g^{2}+2 d e f g +e^{2} f^{2}\right ) \ln \left (e x +d \right )}{8 e^{3} d^{3}}+\frac {\left (-d^{2} g^{2}-2 d e f g -e^{2} f^{2}\right ) \ln \left (-e x +d \right )}{8 e^{3} d^{3}}\) | \(148\) |
risch | \(\frac {\frac {d^{2} g^{2}-e^{2} f^{2}}{2 d \,e^{3}}+\frac {\left (3 d^{2} g^{2}-2 d e f g -e^{2} f^{2}\right ) x}{4 d^{2} e^{2}}}{\left (e x +d \right )^{2}}-\frac {\ln \left (-e x +d \right ) g^{2}}{8 e^{3} d}-\frac {\ln \left (-e x +d \right ) f g}{4 e^{2} d^{2}}-\frac {\ln \left (-e x +d \right ) f^{2}}{8 e \,d^{3}}+\frac {\ln \left (e x +d \right ) g^{2}}{8 e^{3} d}+\frac {\ln \left (e x +d \right ) f g}{4 e^{2} d^{2}}+\frac {\ln \left (e x +d \right ) f^{2}}{8 e \,d^{3}}\) | \(170\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 145, normalized size = 1.67 \begin {gather*} \frac {2 \, d^{3} g^{2} - 2 \, d f^{2} e^{2} + {\left (3 \, d^{2} g^{2} e - 2 \, d f g e^{2} - f^{2} e^{3}\right )} x}{4 \, {\left (d^{2} x^{2} e^{5} + 2 \, d^{3} x e^{4} + d^{4} e^{3}\right )}} + \frac {{\left (d^{2} g^{2} + 2 \, d f g e + f^{2} e^{2}\right )} e^{\left (-3\right )} \log \left (x e + d\right )}{8 \, d^{3}} - \frac {{\left (d^{2} g^{2} + 2 \, d f g e + f^{2} e^{2}\right )} e^{\left (-3\right )} \log \left (x e - d\right )}{8 \, d^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 261 vs.
\(2 (85) = 170\).
time = 2.93, size = 261, normalized size = 3.00 \begin {gather*} \frac {6 \, d^{3} g^{2} x e + 4 \, d^{4} g^{2} - 2 \, d f^{2} x e^{3} - 4 \, {\left (d^{2} f g x + d^{2} f^{2}\right )} e^{2} + {\left (d^{4} g^{2} + f^{2} x^{2} e^{4} + 2 \, {\left (d f g x^{2} + d f^{2} x\right )} e^{3} + {\left (d^{2} g^{2} x^{2} + 4 \, d^{2} f g x + d^{2} f^{2}\right )} e^{2} + 2 \, {\left (d^{3} g^{2} x + d^{3} f g\right )} e\right )} \log \left (x e + d\right ) - {\left (d^{4} g^{2} + f^{2} x^{2} e^{4} + 2 \, {\left (d f g x^{2} + d f^{2} x\right )} e^{3} + {\left (d^{2} g^{2} x^{2} + 4 \, d^{2} f g x + d^{2} f^{2}\right )} e^{2} + 2 \, {\left (d^{3} g^{2} x + d^{3} f g\right )} e\right )} \log \left (x e - d\right )}{8 \, {\left (d^{3} x^{2} e^{5} + 2 \, d^{4} x e^{4} + d^{5} e^{3}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 185 vs.
\(2 (75) = 150\).
time = 0.49, size = 185, normalized size = 2.13 \begin {gather*} - \frac {- 2 d^{3} g^{2} + 2 d e^{2} f^{2} + x \left (- 3 d^{2} e g^{2} + 2 d e^{2} f g + e^{3} f^{2}\right )}{4 d^{4} e^{3} + 8 d^{3} e^{4} x + 4 d^{2} e^{5} x^{2}} - \frac {\left (d g + e f\right )^{2} \log {\left (- \frac {d \left (d g + e f\right )^{2}}{e \left (d^{2} g^{2} + 2 d e f g + e^{2} f^{2}\right )} + x \right )}}{8 d^{3} e^{3}} + \frac {\left (d g + e f\right )^{2} \log {\left (\frac {d \left (d g + e f\right )^{2}}{e \left (d^{2} g^{2} + 2 d e f g + e^{2} f^{2}\right )} + x \right )}}{8 d^{3} e^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 1.28, size = 151, normalized size = 1.74 \begin {gather*} \frac {{\left (\frac {3 \, d^{2} g^{2} e^{3}}{x e + d} - \frac {d^{3} g^{2} e^{3}}{{\left (x e + d\right )}^{2}} - \frac {2 \, d f g e^{4}}{x e + d} + \frac {2 \, d^{2} f g e^{4}}{{\left (x e + d\right )}^{2}} - \frac {f^{2} e^{5}}{x e + d} - \frac {d f^{2} e^{5}}{{\left (x e + d\right )}^{2}}\right )} e^{\left (-6\right )}}{4 \, d^{2}} - \frac {{\left (d^{2} g^{2} + 2 \, d f g e + f^{2} e^{2}\right )} e^{\left (-3\right )} \log \left ({\left | -\frac {2 \, d}{x e + d} + 1 \right |}\right )}{8 \, d^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.13, size = 100, normalized size = 1.15 \begin {gather*} \frac {\frac {d^2\,g^2-e^2\,f^2}{2\,d\,e^3}-\frac {x\,\left (-3\,d^2\,g^2+2\,d\,e\,f\,g+e^2\,f^2\right )}{4\,d^2\,e^2}}{d^2+2\,d\,e\,x+e^2\,x^2}+\frac {\mathrm {atanh}\left (\frac {e\,x}{d}\right )\,{\left (d\,g+e\,f\right )}^2}{4\,d^3\,e^3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________